package com.portal.system.api;

import com.portal.common.core.constant.SecurityConstants;
import com.portal.common.core.constant.ServiceNameConstants;
import com.portal.common.core.domain.R;
import com.portal.system.api.factory.RemoteMqFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * MQ服务
 *
 * @author portal
 */
@FeignClient(contextId = "RemoteMqService", value = ServiceNameConstants.MQ_SERVICE, fallbackFactory = RemoteMqFallbackFactory.class)
public interface RemoteMqService {
    /**
     * 通过消息微服务发送消息
     *
     * @return 结果
     */

    @PostMapping("/rabbitmq/send")
    R<String> sendMessage(@RequestHeader(SecurityConstants.FROM_SOURCE) String source,
                          @RequestParam("exchange") String exchange,
                          @RequestParam("routingKey") String routingKey,
                          @RequestParam("queue") String queue,
                          @RequestParam("message") String message);
}
